#ifndef ASPARASEXML_H
#define ASPARASEXML_H

#include <QObject>
#include <QString>
#include <QStringList>
#include <QDomNodeList>

#include "ASDataDefine.h"
//typedef	struct tag_ASResultInfo ASResultInfo;
class ASParaseXml;
class ASParaseXmlThread : public QObject{
	Q_OBJECT
public:

	friend ASParaseXml;
	ASParaseXmlThread(QObject* parent = 0)
	{
		m_nStartIndex = -1;
		m_nEndIndex = -1;
		m_pParent = parent;
	};
	~ASParaseXmlThread(){};

	void	setStartAndEndIndex(int nStartIndex,int nEndIndex);
	
private:
	int		m_nStartIndex;
	int		m_nEndIndex;
   	QVector<VTPoint> m_vtPoints;
	QObject*	m_pParent;
public slots:
	void	doParaseXml();
	//void	readXml();
signals:
	void	finished();
};


class ASParaseXml : public QObject
{
	Q_OBJECT

public:
	friend ASParaseXmlThread;
	ASParaseXml(QString strFileName,QObject *parent);
	~ASParaseXml();

	bool			startParaseXml();

protected:
	bool			paraseResultInfo(ASResultInfo*,const QDomNodeList& subNodeList);
	bool			paraseBubbleInfo(ASResultInfo*,const QDomNodeList& subNodeList);
	bool			paraseLineInfo(ASResultInfo*,const QDomNodeList& subNodeList);
	bool			doParaseXmlThread(int nJobs,int nStarts);
	bool			delaterParaseXml();
private:
	QString			m_strFileName;
	QStringList		m_lstPtsInfo;
	ASResultInfo	m_stuResultInfo;
	QList<ASParaseXmlThread*>  m_listThread;
	int				m_nFinishedThread;

protected slots:
	void			finishedThread();
};

#endif // ASPARASEXML_H
